﻿using Zhaoxi.ReadingPlatform.Tools;

namespace Zhaoxi.ReadingPlatform.WebSiteApi.Utility
{
    public static class CustomCorsExt
    {
        public static void AddCorsExt(this IServiceCollection services)
        {
            services.AddCors(options =>
            {
                // 配置一个跨域策略
                options.AddPolicy(GlobalVariables.ALL_CORS, corsBuilder =>
                {
                    corsBuilder.AllowAnyOrigin()
                        .AllowAnyMethod()
                        .AllowAnyHeader();
                });
            });
        }
    }
}
